/***********************************************************************************
**  
* @copyright (c) 2010-2019, ChengDu Duyer Technology Co., LTD. All Right Reserved.
*
************************************************************************************/
/**
* @file	    mjs_client_proxy.h
* @version     
* @brief      
* @author   duye
* @date	    2016-12-22
* @note 
*
* 1. 2016-12-22 duye Created this file
*/

#pragma once

#include <duye_system.h>
#include <duye_timer.h>
#include <mjs_inner_msg.h>
#include <mjs_client.h>

class MJSOnActionBase;
class MJSReqer;
class MJServer;

/**
 * @brief client proxy
 */
class MJSClientProxy : public MJSClient, public duye::TimerIf
{
public:
	MJSClientProxy(const int32 sockfd, const std::string& ip, MJSOnActionMap* on_action_map, MJServer* sender);
	virtual ~MJSClientProxy();
	
	// implementation MJSClient
	virtual bool handleAction(const std::list<MJMsgAction>& action_list);

private:
	// implementation MJSClient
	bool innerNotify(const MJSInnerMsgType& msg_type, void* data);

	// implementation duye::TimerIf
	virtual bool onTimeout(const uint32 timeout);

	void upateTimeout();

private:
	uint32 m_expire;
};